package com.bootcamp.mall.dao;

import com.bootcamp.mall.model.Order;
import com.bootcamp.mall.model.bo.order.AddOrderBO;
import com.bootcamp.mall.model.bo.order.ChangeOrderBO;
import com.bootcamp.mall.model.bo.order.CommentBO;
import com.bootcamp.mall.model.bo.order.OrderByPageBO;
import com.bootcamp.mall.model.vo.order.GetOrderByStateVO;
import com.bootcamp.mall.model.vo.order.OrderByPageVO;
import com.bootcamp.mall.model.vo.order.OrdersOfOrderByPageVO;
import com.bootcamp.mall.model.vo.order.ShowOrderVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @program: mall
 * @description:
 * @author: Keyu Li
 * @create: 2021-11-11 17:30
 **/

public interface OrderDao {
    Integer selectAllOrdersCount(OrderByPageBO orderByPageBO);

    List<OrdersOfOrderByPageVO> selectOrdersByPage(OrderByPageBO orderByPageBO);

    ShowOrderVO selectOrderById(Integer id);

    /**
     * 根据id修改order表的：状态，总价，数量，specid
     * @param changeOrderBO:
     * @return int
     * @date 11/11/2021 21:27
     */
    int updateOrder(ChangeOrderBO changeOrderBO);

    Integer deleteOrderById(Integer id);

    Integer insertOrder(Order order);

    List<GetOrderByStateVO> selectOrderByNicknameAndState(@Param("state") Integer state, @Param("nickname") String nickname);

    /**
     * 同时修改多个订单的 num，state及 account
     * @param cartList:
     * @return java.lang.Integer
     * @date 11/13/2021 15:39
     */
    Integer updateMultiOrder(ChangeOrderBO cartList);

    Integer insertComment(CommentBO commentBO);
}
